<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>主机管理</title>
	</head>
	<body>
		<h1>欢迎来到主机管理界面</h1>
		{%if status%}
			{{status}}
		{%endif%}
		<div class="addHost">
			<h3>添加主机</h3>
			<h6 style="color: red;">{{status}}</h6>
			<form action="/app01/host/" method="POST">
				<p>主机名：<input name="hostname" placeholder="hostname"></p>
				<p>ip&nbsp;&nbsp;：<input name="ip" placeholder="ip"></p>
				<p>请选择用户组：
					<select name="group">
						{%for item in group%}
							<option value="{{item.id}}">{{item.groupname}}</option>
						{%endfor%}
					</select>
				</p>
				<p><input type="submit" value="添加"/></p>
			</form>
		</div>
		<div class="hostList">
			<h3>主机列表：</h3>
			<table border="1">
				<tr>
					<th>主机名</th>
					<th>IP</th>
					<th>所属用户组</th>
				</tr>
				{%for item in data%}
				<tr>
					<td>{{item.hostname}}</td>
					<td>{{item.ip}}</td>
					<td>{{item.user_group.groupname}}</td>
				</tr>
				{%endfor%}
			</table>
		</div>
	</body>
</html>